public class 链表中倒数第k个节点 {
    class Solution {
        public ListNode getKthFromEnd(ListNode head, int k) {
            ListNode front=head;
            ListNode back=head;
            for (int i = 1; i <= k; i++) {
                front=front.next;
            }
            while(front!=null){
                front=front.next;
                back=back.next;
            }
            return back;
        }
    }
}
